
import 'babel-polyfill'     //注意:这条引入要在 import Vue from ‘vue’ 之前
import Vue from 'vue'
import App from './App'
import router from './router'
import Validator from 'vue-validator'
import Clipboard from 'v-clipboard'

import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';

Vue.use(Validator).use(Clipboard).use(ElementUI);

Vue.config.productionTip = false

//浏览器导航栏字体显示
router.beforeEach((to, from, next) => {
  window.document.title = to.meta.title === undefined ? 'CodeWorld' : to.meta.title
  /*if (to.meta.requireAuth) {
    let token = Cookies.get('access_token');
    if (token) {
      next({
        path: '/login',
        query: {
          redirect: to.fullPath
        }
      })
    }
  }*/
  next();
})
/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  render: h => h(App)
})
